import javax.xml.transform.Result;
import java.sql.*;

public class practice {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        String username="root";
        String password="";
        String url="jdbc:mysql://localhost:3306/mi?characterEncoding=UTF-8";
        Connection con=DriverManager.getConnection(url,username,password);
        System.out.println(con);
        String sql="select * from book";
        Statement st=con.createStatement();
        ResultSet rs=st.executeQuery(sql);
        while(rs.next()){
            String name=rs.getString("author");
            int price=rs.getInt("price");

            System.out.println(price+name);


        }

    }
}
